import request from '@/utils/request'

/**
 * 任务签收
 * @param {} data
 * @returns
 */
export function signFor(taskId) {
  const data = taskId
  return request({
    url: 'api/activiti/signFor',
    method: 'post',
    data
  })
}

/**
 * 任务审批
 * @param {} data
 * @returns
 */
export function approve(data) {
  return request({
    url: 'api/activiti/approve',
    method: 'post',
    data
  })
}

/**
 * 任务审批
 * @param {} taskId
 * @returns
 */
export function rollBack(taskId) {
  return request({
    url: 'api/activiti/rollBack/' + taskId,
    method: 'post'
  })
}

/**
 * 流程明细
 * @param {} data
 * @returns
 */
export function processDetail(procInstId) {
  console.log(procInstId)
  return request({
    url: 'api/actHiTaskinst/processDetail',
    method: 'post',
    data: procInstId
  })
}

export default { signFor, approve, rollBack, processDetail }
